!% -SD !========================== Constant Story "Frater Evanesco"; Constant Headline "^A game for Interactive Fiction Writing Month ^(http://www.instamatique.com/if/) ^by Kevin Jackson-Mead"; Constant MAX_SCORE 5; Replace MakeMatch; Replace Identical; Replace NounDomain; Replace TryGivenObject; Include "Parser"; Include "pname"; Include "VerbLib"; Attribute legible; !========================== ! class objects Class HairClass(1) with description "A single hair from a dead witch (well, she could be a witch).", short_name "hair", name 'hair' 'witch' 'witch^s' 'dead', before [; Drop: "You want to hang onto your spell component."; ], create [; remove ginger_hair; remove fred_hair; ]; Class StrawClass(1) with description "A piece of straw from a broom. It's long and thin.", short_name "piece of straw", name 'straw' 'piece' 'of', before [; Drop: "This piece of straw might come in handy. You decide to hold onto it."; ], create [; remove straw; ]; Class SootClass(1) with description "A plastic baggie full of soot and ash from a fireplace.", short_name "plastic baggie full of soot", name 'plastic' 'baggie' 'bag' 'soot' 'full' 'of', before [; Drop: "This bag of soot might come in handy. You decide to hold onto it."; ], create [; remove soot; ]; Class AshesClass(1) with description "A plastic baggie full of the ashes of a dead man (hopefully honest).", short_name "plastic baggie full of ashes", name 'plastic' 'baggie' 'ashes' 'full' 'of', before [; Drop: "You want to hang onto your spell component."; ]; !========================== ! The game objects !========== ! Act One !========== Object foyer "Foyer" with description "You stand in the foyer of an elegant house, with two chairs flanking a table upon which sits a vase of flowers. Colored light streams through a stained-glass window in the front door of the house to the west. A carpeted staircase leads to the second floor, but it is blocked by a chain with a sign hanging from it. A hallway heads to the east, and archways open to the north and south.", w_to outside, tried_up 0, u_to [; if (self.tried_up++) { deadflag = 3; "^With an unexpected flaring of bravery, you start to unhook the chain. Just then, you hear someone moving around in the hallway upstairs. Task forgotten, you run screaming from the house."; } "The chain blocking the staircase is probably there for a good reason. If David were here, he would probably try to make you go up there, but you'd rather just do what you came here to do and leave.";], n_to sitting_room, e_to "There's unlikely to be anything interesting in the hallway.", s_to funeral_parlor, has light; Object foyer_stuff "objects in the foyer" foyer with description "Everything here is much nicer than the crap at your house. You sometimes wish your mom would care about the house enough to buy stuff like this.", name 'chair' 'chairs' 'table' 'vase' 'flowers' 'stained' 'glass' 'window' 'stained-glass', before [; Take,Remove: "You came here for your spell components, not for petty burglary."; ], has pluralname scenery; Object chain_sign "sign" foyer with description "A neatly stenciled sign hangs from the chain blocking the stairs and reads: EMPLOYEES ONLY.", name 'sign' 'chain' 'staircase' 'stairs', has scenery; Object outside "In front of a large house" with description "You are standing outside a well-maintained two-story Victorian house. There is a sign on a post in the front lawn. The front door is to the east.", e_to foyer, first_time true, initial [; if (self.first_time) { self.first_time = false; style bold; print "^^Act I: Heavenly Rest^^"; style roman; } ], each_turn [ i has_hair has_ashes; objectloop (i && i in player) { if (i ofclass HairClass) has_hair = true; if (i ofclass AshesClass) has_ashes = true; } if (has_hair && has_ashes) { ! Let's move on to Act Two score++; print "^^Your sense of accomplishment and relief at getting the spell components and getting out of that house is quickly extinguished when you realize that you now need to go home.^^^"; style bold; print "Act II: Home Again, Home Again^^"; style roman; PlayerTo(home_foyer); return true; } ], has light; Object lawn_sign "sign" outside with description "A sturdy wooden sign on a wooden post, both painted white. The large capital letters on the sign are done in metallic gold paint thinly outlined in black.", name 'sign' 'post' 'signpost', before [; Read: "HEAVENLY REST FUNERAL HOME"; ], has legible scenery; Object house "house" outside with description "Even in the middle of the day, this house looks pretty creepy. Best to just do what you came here to do and get out as quickly as possible.", pname '.x' 'victorian' '.x.' 'two-story' 'house', has scenery; Object sitting_room "Sitting room" with description "This would be a lovely sitting room except for the fact that there's nothing to sit on. A fireplace sits at the east end of the room, with some tools next to it. An archway leads south to the foyer.", s_to foyer, has light; ! from first week !Object card "calling card" ! with description "This antique calling card is double-sided. One side reads: Fred likes steel. The other side !reads: Ginger likes pine.", ! name 'card' 'calling'; Object tools "fireplace tools" sitting_room with description "A little shovel and a little broom sit in a cast-iron stand.", pname '.x' 'fireplace' 'tools', before [; Take,Remove: "You came here for your spell components, not for petty burglary."; ], has pluralname scenery; Object shovel "shovel" sitting_room with description "A little cast-iron shovel, obviously used to scoop soot from the fireplace.", name 'shovel' 'iron' 'cast-iron' 'little', before [; Take: "You only came here to get your spell components, not for petty burglary."; ], has scenery; Object broom "broom" sitting_room with description "A little broom to keep things tidy. The business end is made of long, thin pieces of straw.", name 'broom' 'little', before [; Take: "You only came here to get your spell components, not for petty burglary."; Pluck: <>; ], has scenery container transparent; Object straw "piece of straw" broom with description "The broom is rather old. You could probably pluck a piece of straw out of it.", name 'straw' 'piece' 'of', before [ straw_obj; Pluck,Take,Remove: score++; straw_obj = StrawClass.create(); move straw_obj to player; "You pluck out one of the pieces of straw from the broom."; ], has scenery; Object fireplace "fireplace" sitting_room with description "The inside of the fireplace is covered in a thick layer of soot. It looks like it hasn't been used in quite some time.", name 'fireplace' 'fire' 'place', ! from first week !before [; ! Search: !move card to sitting_room; ! "You poke around the fireplace, and you find a small card buried under the soot."; !], has scenery container transparent open; Object soot "soot" fireplace with description "The soot in the fireplace is quite plentiful. You could probably scoop some up without anyone noticing that any is missing.", name 'soot' 'ash', before [soot_obj; Pluck,Scoop,Take,Remove: score++; soot_obj = SootClass.create(); move soot_obj to player; "You pull out a plastic baggie from the pocket of your trenchcoat and carefully use the shovel to scoop up a bagful of soot."; ], has scenery pluralname; Object funeral_parlor "Funeral parlor" with description "Several rows of chairs, split by a center aisle, face two caskets at the south end of the room. A podium sits to the east of the caskets. There are vases of flowers on small tables along the east side of the room. An ornate urn sits on a mantelpiece on the west side of the room. From somewhere, peaceful organ music is quietly playing. An archway leads north to the foyer.", n_to foyer, ! from first week ! each_turn [; if (fred_corpse in right_casket && ginger_corpse in left_casket) deadflag = 2; ] before [; Listen: <>; ], has light; Object music "music" funeral_parlor with description "This is the kind of music you hear when your mom drags you to church against your will, trying to ~save your soul.~", pname '.x' 'peaceful' '.x' 'organ' 'music', before [; Listen: <>; ], has scenery; Object mantelpiece "mantelpiece" funeral_parlor with description "The mantelpiece is against the wall but doesn't have a fireplace under it, so it's really more of a shelf. It has an ornate urn on it.", name 'mantel' 'mantelpiece' 'piece' 'fireplace' 'fire' 'place', has scenery supporter; Object urn "ornate urn" mantelpiece with description [; print "This ornate urn is black and is painted with vines and flowers. It looks like the kind of urn they put someone's ashes in after they're cremated."; if (self has open) print " It is full of someone's ashes."; ""; ], pname '.x' 'ornate' '.x' 'black' 'urn', before [; Take,Remove: "You came here for your spell components, not for petty burglary."; Receive: if (self has open && noun ofclass SootClass) <>; if (self hasnt open) { ; <>; } "You don't want to defile the urn."; ], after [; Open: "You lift the lid of the urn, and you see ashes inside."; ], has scenery container openable; Object ashes "ashes" urn with description "The cremated remains of someone, hopefully a man, or at least a human.", pname '.x' 'man' '.x' 'man^s' 'ashes' '.x' 'honest' '.x' 'cremated' 'remains', before [i ashes_obj; Pluck,Take,Remove: objectloop (i && i in player) { if (i ofclass SootClass) { score++; remove i; ashes_obj = AshesClass.create(); move ashes_obj to player; "You pull out another plastic baggie from your trenchcoat and carefully empty the ashes into it. You don't want this guy's family worrying that he's missing, so you carefully replace the ashes with the baggie of fireplace soot."; } } "These ashes should work for your spell, but you'd feel guilty if the guy's family went to scatter his ashes and nothing came out of the urn. You'll have to find something to replace it with."; ], has scenery pluralname; Object parlor_furniture "furniture" funeral_parlor with description "Pretty much everything in here reminds you of church, which your mom forces you to attend (when you don't leave the house early enough on Sundays).", name 'podium' 'vase' 'vases' 'flower' 'flowers' 'tables' 'table' 'furniture', before [; Take: "You only came here to get your spell components, not for petty burglary."; ], has scenery; Object caskets "caskets" funeral_parlor with description "Two beautiful caskets sit on stands at the end of the room. The casket on the left is made of lacquered wood with gold hardware. The casket on the right is made of a blue metal with silver hardware.", name 'caskets', has scenery; Object left_casket "wooden casket" funeral_parlor with description "This casket is made of lacquered pine and has gold handles and trim. It is beautifully hand-carved, with intricate scrollwork all along the sides.", name 'casket' 'wooden' 'wood' 'left' 'pine', has scenery container openable; Object fred_corpse "male corpse" left_casket with description "This corpse looks almost alive, like he has simply closed his eyes. He is a healthy-looking old man with a full head of white hair. He is wearing a nice dark blue suit with a white shirt. He is wearing a red tie with a matching red handkerchief coming out of the breast pocket of his suit jacket.", name 'fred' 'corpse' 'male' 'man', before [; Take,Remove: "The corpse is probably too heavy for you to lift. Also, um, no."; Receive: "You didn't come here to defile old men's corpses."; ], has static container transparent open; Object fred_clothes "clothing" fred_corpse with description "His clothing is definitely what you would call ~dressy~ but probably not very expensive.", pname '.x' 'dark' '.x' 'blue' 'suit' '.x' 'white' 'shirt' 'clothing' 'clothes' '.x' 'red' 'tie' 'handkerchief' 'jacket', before [; Take,Remove: "You only came here to get your spell components, not for petty burglary."; ], has scenery; Object fred_hair "man's hair" fred_corpse with description "The man's full head of white hair is close-cropped.", pname '.x' 'man' '.x' 'man^s' '.x' 'white' 'hair', before [; Take,Remove,Pluck: "Men can't be witches, can they? This hair won't do you any good as a spell component, so you decide to leave it in peace."; ], has scenery; Object right_casket "metal casket" funeral_parlor with description "This casket is made of blue steel and has silver handles and trim. It is beautifully etched with patterns resembling Celtic knots.", name 'casket' 'metal' 'steel' 'right' 'blue', has scenery container openable; Object ginger_corpse "female corpse" right_casket with description "This corpse is in an advanced state of decay. She has long wispy gray hair, and her skin is dry, taut, and almost the same color as her hair. You can hardly make out any facial features. She is wearing a simple gray dress that might have once been black. A string of pearls hangs around her neck.", name 'ginger' 'female' 'corpse' 'woman', before [; Take,Remove: "The corpse is probably too heavy for you to lift. Also, um, no."; Receive: if (noun ofclass StrawClass) <>; "You don't want to defile the corpse any more than you have to."; ], has static container transparent open; Object ginger_clothes "clothing" ginger_corpse with description "The woman's clothing and jewelry must have been very fine once.", pname 'clothing' 'clothes' 'jewelry' '.x' 'gray' 'dress' '.x' 'black' 'string' '.x' 'of' 'pearls' 'necklace', before [; Take,Remove: "You only came here to get your spell components, not for petty burglary."; ], has scenery; Object ginger_hair "woman's hair" ginger_corpse with description "This woman's hair is probably the closest thing you'll find to a witch's hair.", pname '.x' 'witch' '.x' 'witch^s' '.x' 'woman' '.x' 'woman^s' 'hair', before [i hair_obj; Take,Remove,Pluck: objectloop (i && i in player) { if (i ofclass StrawClass) { score++; remove i; hair_obj = HairClass.create(); move hair_obj to player; "You carefully pluck out one of the woman's hairs. Because you feel guilty about robbing the dead, you stick the piece of straw in the woman's head as a replacement."; } } "Her hair would be perfect for your spell, but you'd feel guilty robbing the dead. At the very least, you'll have to find something to replace it with."; Receive: if (noun ofclass StrawClass) <>; "You don't want to defile the corpse any more than you have to."; ], has scenery pluralname container; !========== ! Act Two !========== Object home_foyer "Foyer" with description "Especially after being in that funeral home, your house looks crappy. There's a trash-picked table that is piled with junk mail and who knows what else. The rug is worn so thin that you can see the floor through it in several places. You can hear the television coming from the living room to the west. The kitchen is to the east. The front door is south of you, and stairs lead up to the north", s_to "It's after curfew. Time to stay inside.", n_to [; print "As you try to walk by him, David grabs your arm and stops you from leaving.^^~Where's the crap from your spell, "; david.insult(); "?~"; ], u_to [; print "As you try to walk by him, David grabs your arm and stops you from leaving.^^~Where's the crap from your spell, "; david.insult(); "?~"; ], w_to [; print "As you try to walk by him, David grabs your arm and stops you from leaving.^^~Where's the crap from your spell, "; david.insult(); "?~"; ], e_to [; print "As you try to walk by him, David grabs your arm and stops you from leaving.^^~Where's the crap from your spell, "; david.insult(); "?~"; ], has light; Object home_living "Living room" with description "Your living room. Couch, TV. Crappy.", e_to home_foyer, has light; Object home_kitchen "Kitchen" with description "Your kitchen. Door to the basement. Crappy.", w_to home_foyer, d_to home_basement, has light; Object home_hallway "Upstairs hallway" with description "Your hallway. Doors to your bedroom, your brother's bedroom, you mother's bedroom. Crappy", w_to home_bedroom, e_to home_brother_bedroom, n_to "You're not supposed to go into your mom's room.", d_to home_foyer, has light; Object home_bedroom "Your bedroom" with description "Your bedroom. Crappy, but it's your refuge.", e_to home_hallway, has light; Object home_brother_bedroom "David's bedroom" with description "Your brother's bedroom. Crappy.", w_to home_hallway, has light; Object home_basement "The basement" with description "The basement. Dank and crappy. But dark enough.", u_to home_kitchen, has light; Object david "David" home_foyer with description "Your brother, David.", name 'David' 'brother' 'frater', last1_insult 0, last2_insult 0, last3_insult 0, insult [x; while((x=random(9))== self.last1_insult or self.last2_insult or self.last3_insult); self.last3_insult = self.last2_insult; self.last2_insult = self.last1_insult; self.last1_insult = x; switch(x) { 1: print "nerd"; 2: print "geek"; 3: print "asshole"; 4: print "douche"; 5: print "fucknut"; 6: print "fucker"; 7: print "twat"; 8: print "psycho"; 9: print "pussy"; } ], each_turn [; if (score == 7) { deadflag = 4; "^Having given David what he asked for, he gives you a little shove, goes to watch TV, and leaves you alone for the rest of the night."; } if (random(3)==1) { switch(random(2)) { 1: print "^David says, ~You make me sick, "; break; 2: print "^David says, ~Don't make me pound you, "; break; } self.insult(); print ".~^"; return true; } ], life [; Give: if (noun ofclass HairClass) { print "You give the dead woman's hair to David.^^~What the fuck is this? Don't tell me you actually took this from some dead witch.~^"; remove noun; score++; return true; } if (noun ofclass AshesClass) { print "You give the ashes to David.^^~No way this is some dead fucker's ashes.~^"; remove noun; score++; return true; } print "~Don't give me your shit, "; self.insult(); print ".~^"; return true; Show: print "~This isn't fucking show and tell, "; self.insult(); ".~"; ] has animate proper; !========================== ! Player's inventory Object note "page from a notebook" with description "A page ripped out of your ~grimoire~ (that is, a spiral-bound notebook). In red pen, it says: ^^FRATER EVANESCO ^^Components: ^one long hair of a dead witch ^the ashes of an honest man ^^Directions: ^1. In a room with no light, cover the hair completely with the ashes. ^2. Let sit for one hour. ^3. Remove the hair from the ashes and place it under the pillow of the offending brother. ^4. Within a week, the brother will have left the house.", name 'page' 'note' 'notebook' 'book' 'spell' 'grimoire', before [; Insert,Drop: "When you are a great sorcerer, your early spells will be valuable, powerful artifacts. You'd better hang onto it."; ]; Object trenchcoat "black trenchcoat" with description "A standard-issue black trenchcoat.", name 'trenchcoat' 'trench' 'coat' 'black', before [; Drop,Disrobe,Insert: "You wouldn't be caught dead without your trenchcoat!"; ], has clothing; !========================== ! Entry point routines [ Initialise; location = outside; lookmode = 2; move note to player; move trenchcoat to player; give trenchcoat worn; player.description = "You know you're overweight, but at least you're about average height for a tenth grader, so they can't pick on you for being short, too. And you look very dark and mysterious in your black trenchcoat."; print_ret "^^Your brother David caught you writing in your ~grimoire.~ It wouldn't have been quite so bad if he didn't know Latin. And now he's made you come here to gather the components for your spell.^^"; ]; [ DeathMessage; switch (deadflag) { 3: print "You have chickened out"; 4: print "You have survived another day"; } ]; !========================== ! Standard and extended grammar Include "Grammar"; [ ReadSub; <>; ]; Extend 'read' first * legible -> Read; [ ScoopSub; "You aren't sure how you're going to scoop that."; ]; Verb 'scoop' * noun -> Scoop * noun topic -> Scoop; [ PluckSub; "You aren't sure how you're going to pluck that."; ]; Verb 'pluck' * noun -> Pluck * noun topic -> Pluck; !==========================